package principle.dependencyInversion;

/*
    使用依赖倒转原则来实现Demo01案例
 */
public class Demo02 {
    public static void main(String[] args) {
        SendTools email = new Email1();
        SendTools weChat =new WeChat1();
        email.sendMessage();
        weChat.sendMessage();
    }
}
interface SendTools{
    public void sendMessage();
}
class Email1 implements SendTools{
    @Override
    public void sendMessage(){
        System.out.println("Email发送的消息...");
    }
}
class WeChat1 implements SendTools{
    @Override
    public void sendMessage(){
        System.out.println("WeChat发送的消息...");
    }
}
class Person1{
    public void getInfo(SendTools sendTools){
        sendTools.sendMessage();
    }
}
